/*
 * test_time.cpp
 *
 *  Created on: Jan 2, 2014
 *      Author: killerg
 */


#include <time.h>
#include <stdio.h>
#include <string>
#include <sstream>

bool test_time() {
    std::stringstream ss;
    double dvalue = 1.0f;
    for (int i=0; i<1000000000; ++i) {
        ss.str("");
        ss << (dvalue += 1.0f);
        printf("%s\n", ss.str().c_str());
    }

    time_t pt = time(NULL);
    tm ltm = *localtime(&pt);
    tm gtm = *gmtime(&pt);

    int diff = 2 - ltm.tm_wday;
    if (diff < 0)
        diff += 7;
    tm end = ltm;
    end.tm_mday += diff;
    end.tm_hour = 3;
    end.tm_min = 0;
    end.tm_sec = 0;
    mktime(&end);




    printf("ltm: %s", asctime(&ltm));
    printf("gtm: %s", asctime(&gtm));
    printf("end: %s", asctime(&end));
    return true;
}

